package com.yazi.mxz.common.entity.beans;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * AdminRoleId entity. @author MyEclipse Persistence Tools
 */
@Embeddable
public class AdminRoleId implements java.io.Serializable {

	// Fields

	private Long adminId;
	private Long roleId;

	// Constructors

	/** default constructor */
	public AdminRoleId() {
	}

	/** full constructor */
	public AdminRoleId(Long adminId, Long roleId) {
		this.adminId = adminId;
		this.roleId = roleId;
	}

	// Property accessors

	@Column(name = "ADMIN_ID", nullable = false, precision = 15, scale = 0)
	public Long getAdminId() {
		return this.adminId;
	}

	public void setAdminId(Long adminId) {
		this.adminId = adminId;
	}

	@Column(name = "ROLE_ID", nullable = false, precision = 15, scale = 0)
	public Long getRoleId() {
		return this.roleId;
	}

	public void setRoleId(Long roleId) {
		this.roleId = roleId;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof AdminRoleId))
			return false;
		AdminRoleId castOther = (AdminRoleId) other;

		return ((this.getAdminId() == castOther.getAdminId()) || (this.getAdminId() != null
				&& castOther.getAdminId() != null && this.getAdminId().equals(
				castOther.getAdminId())))
				&& ((this.getRoleId() == castOther.getRoleId()) || (this.getRoleId() != null
						&& castOther.getRoleId() != null && this.getRoleId().equals(
						castOther.getRoleId())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result + (getAdminId() == null ? 0 : this.getAdminId().hashCode());
		result = 37 * result + (getRoleId() == null ? 0 : this.getRoleId().hashCode());
		return result;
	}

}